import Koa from "koa";
import router from "./router/index.js";
import koaCors from "koa-cors";
import { sync } from "./db/index.js";
import bodyparser from "koa-bodyparser";

const app = new Koa();

app.use(bodyparser())

app.use(koaCors())

sync()

app.use(router)

app.listen("3000", () => {
    console.log("服务运行地址如下 \nhttp://localhost:3000");
})